
	
	
	$(document).ready(function(){
		var path	=	base_url;
		var services = '';
		
		jQuery("img#note3").click(function(){
			//$(".tip_upload").css("display","none");
			//var id = $(this).attr('id');
			
			$('#tip_note3').show();
			return false; 
		});

		$.post(path+'apply/change_type/',{type_id:$("#type_of_visa :selected").val()},function(data){
			$("#show_type_of_visa").html(data);
		});
		
		$('#type_of_visa').change(function(){
			$.post(path+'apply/change_type/',{type_id:$("#type_of_visa :selected").val()},function(data){
				$("#show_type_of_visa").html(data);
			});
		});
		
		$.post(base_url+'apply/change_purpose/',{purpose_id:$("#purpose :selected").val()},function(data){
			$("#show_purpose").html(data);	
		});
		
		$("#purpose").change(function(){
			$.post(base_url+'apply/change_purpose/',{purpose_id:$("#purpose :selected").val()},function(data){
				$("#show_purpose").html(data);	
			});	
		});
		
		$(".processing_c").click(function(){
			$("#show_process").html($(this).parent().find("span").eq(0).text());
		});
		
		$.post(
				path+'apply/change_number/',
				{number_id:$("#number_of_visa :selected").val()},
				function(data){
					$("#show_number_of_visa").html(data);
				}
		);
		
		$('#number_of_visa').change(function(){
			$.post(
					path+'apply/change_number/',
					{number_id:$("#number_of_visa :selected").val()},
					function(data){
						$("#show_number_of_visa").html(data);
					}
			);
		});
		
		
		
		$(".change_price_click").each(function(index) {

			
			if($(this).attr("checked") == true)
				services = $(this).val();
		});

		$.post(
				path+'apply/get_price_ajax/',
				{number_visa:$("#number_of_visa :selected").val(),type_visa:$("#type_of_visa :selected").val(),service:services},
				function (data){
					$("#show_total_price").html(data);
				}
		);
		
		$(".change_price").change(function(){
			$("#show_total_price").html("Loading ...");
			
			$(".change_price_click").each(function(index) {
				if($(this).attr("checked") == true)
					services = $(this).val();
			});
			$.post(
					base_url+'apply/get_price_ajax/',
					{number_visa:$("#number_of_visa :selected").val(),type_visa:$("#type_of_visa :selected").val(),service:services},
					function (data){
						$("#show_total_price").html(data);
					}
			);
		});
		
		$(".change_price_click").change(function(){
			if( $(this).val() == "super_urgent" && $(this).attr('checked') == 'checked')
			{
				$("#tip_note3").show();
				return false;
			}
			
			$("#show_total_price").html("Loading ...");

			$.post(
					base_url+'apply/get_price_ajax/',
					{number_visa:$("#number_of_visa :selected").val(),type_visa:$("#type_of_visa :selected").val(),service:$(this).val()},
					function (data){
						$("#show_total_price").html(data);
					}
			);
		});
		
		
		$(".step1-submit").click(function(){
			var i = 0;
			$(".change_price_click").each(function(index) {
				if($(this).val() == "super_urgent" && $(this).attr('checked') == 'checked')
				{
					i = 1;
					$("#tip_note3").show();
					return false;
				} 
			});
			
			if(i==0){
				return true;
			}else{
				return false;
			} 
		});
		
		
		
	});
	

	